<?php 

include '../function.php';
$list = include './list.php';


$big = array();

foreach ($list as  $value) {
	$tmp =array();
	$url = "http://www.lagou.com/jobs/".$value.".html";
	$data = file_get_contents($url);
	$preg = "/<h1\stitle=\"(.+)\">/";

	preg_match($preg, $data , $math);//$math匹配结果
	$tmp['jobname'] =$math[1];//$math[1]0和1项 1项更准确 取1项
	// var_dump($math[1]);
	// break;
	$preg = "/<span\sclass=\"red\">(.+)<\/span>/";

	preg_match($preg, $data , $math);

	$tmp['money'] =$math[1];
	

	$preg = "/<span>(.+)<\/span>/";

	preg_match($preg, $data , $math);
	// var_dump($math);
	// break;
	$tmp['position'] =$math[1];


	$preg = "/<span>(.+)<\/span>/";
	preg_match_all($preg, $data , $math);
	$tmp['adf'] =$math[1][1];
	$tmp['edu'] =$math[1][2];
	$tmp['qwfef'] =$math[1][3];


	$preg = "/<p>(.+)<\/p>/";
	preg_match($preg, $data , $math);
	$tmp['weal'] =$math[1];
	


	$preg = "/<span>(.+)<\/span>/";
	preg_match_all($preg, $data , $math);
	$tmp['weergal'] =$math[1][6];
	

	$preg = "/<h4>(.+)<\/h4>/";
	preg_match_all($preg, $data , $math);
	$tmp['sdf23'] =$math[1][1];
	

	$preg = "/<div>(.+)<\/div>/";
	preg_match_all($preg, $data , $math);
	$tmp['address'] =$math[1][1];
	// 	var_dump($math);
	// break;

	$preg = "/<p\sclass=\"f16\">(.+)<\/p>/";
	preg_match_all($preg, $data , $math);
	$tmp['2123'] =$math[1][0];
	// var_dump($math);
	// break;
	$big[] = $tmp;


}

	$data = var_export($big,true);
	$data = "<?php return $data ?>";
	// var_dump($data);
	file_put_contents("./job.php", $data);




 ?>